Skip to content

Conversation

@rekmarks
Copy link
Member

@rekmarks rekmarks commented Dec 10, 2025

Migrates all instances of JsonRpcEngine to JsonRpcEngineV2. This only affects kernel-browser-runtime and should not change its behavior. The UI -> kernel JSON-RPC API can now handle JSON-RPC notifications (i.e. requests without an id), should we ever wish to add any.


Note

Migrates kernel-browser-runtime to @metamask/json-rpc-engine v2, updates middleware/tests, and enables handling JSON-RPC notifications in UI↔kernel messaging.

  • Kernel Browser Runtime:
    • Switch from JsonRpcEngine to JsonRpcServer/JsonRpcEngineV2 in src/kernel-worker/kernel-worker.ts and middleware.
    • Update middleware APIs:
      • logging: rewritten for v2 JsonRpcMiddleware.
      • panel-message: renamed to makePanelMessageMiddleware, uses v2 API and returns results directly.
    • ui-connections: handle JSON-RPC notifications (no id) by not sending replies; adjust handler type to return JsonRpcResponse | void.
    • Tests updated for v2 engine, middleware behavior, and notification handling.
  • Dependencies:
    • Bump @metamask/json-rpc-engine to ^10.2.0; lockfile updated.
  • Tooling:
    • ESLint: allow @typescript-eslint/no-non-null-assertion in tests; update Vitest plugin link.
    • Coverage thresholds slightly adjusted in vitest.config.ts.

Written by Cursor Bugbot for commit b1961a4. This will update automatically on new commits. Configure here.

@socket-security
Copy link

socket-security bot commented Dec 10, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​json-rpc-engine@​10.1.1 ⏵ 10.2.010010010090 +2100

View full report

@socket-security

This comment was marked as resolved.

@rekmarks
Copy link
Member Author

@SocketSecurity ignore npm/klona

The "anomaly" is that a generalized deep clone in JavaScript may have side effects.

@rekmarks rekmarks marked this pull request as ready for review December 10, 2025 23:55
@rekmarks rekmarks requested a review from a team as a code owner December 10, 2025 23:55
@rekmarks rekmarks merged commit 6074042 into main Dec 11, 2025
26 checks passed
@rekmarks rekmarks deleted the rekm/json-rpc-engine-v2 branch December 11, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants